<?php
/* @var $this BodegaSateliteController */
/* @var $model bodegaSatelite */
/* @var $form CActiveForm */
?>
<?php if (Yii::app()->user->hasFlash('success')): ?>
	<div class="alert alert-success">
		<?php echo Yii::app()->user->getFlash('success'); ?>
	</div>
<?php endif ?>
<?php if (Yii::app()->user->hasFlash('error')): ?>
	<div class="alert">
		<?php echo Yii::app()->user->getFlash('error'); ?>
	</div>
<?php endif ?>
<div class="form">

<!--  Tooltip-->
<?php
$this->widget('application.extensions.tipsy.Tipsy', array(
  'fade' => false,
  'gravity' => 'n',
  'items' => array(
    array('id' => '.tooltipster'),
    array('id' => '#tooltipster'),
    array('id' => array('model' => $model, 'attribute' => 'model_attribute_name')
     ,'fallback' => 'Put custom tooltip here.' ),    
  ),  
));
?>



<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'bodega-satelite-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	

	<?php echo $form->errorSummary($model); ?>

	

	<div class="row">
		<?php echo $form->labelEx($model,'Bo_idcodigo_FK'); ?>
		<?php echo $form->dropDownList($model,'Bo_idcodigo_FK', CHtml::listData(bodegas::model()->findAll(), 'Bo_idcodigo_PK', 'Bo_nombrebodega'),array('style'=>'width:24%' ));?>
		<?php echo"<img src='../images/help_icon.gif' class='tooltipster' title='Código de la bodega a la cual serán agregados los productos.'>" ?>
		<?php echo $form->error($model,'Bo_idcodigo_FK'); ?>
	</div>
     
   
	<div class="row">

		<?php echo $form->labelEx($model,'Pr_idproducto_FK'); ?>		
		<?php
		$this->widget('ext.select2.ESelect2', array(
		  'model' => $model,
		  'attribute' => 'Pr_idproducto_FK',
		  'data' => CHtml::listData(catalogo::model()->findAll(), 'Pr_idproducto_PK', 'Pr_idproducto_PK'),
		  'options' => array(
		    'placeholder' => "Seleccione el producto",
		    'allowClear'=>true,
		    //'minimumInputLength'=>2,
		  ),
		  'htmlOptions'=>array(
		    'style'=>'width:24%',
		    //'multiple'=>'multiple',
		  ),
		));
		?>
			
		<?php echo"<img src='../images/help_icon.gif' class='tooltipster' title='Código que identifica de forma única cada producto.'>" ?>
		<?php echo $form->error($model,'Pr_idproducto_FK'); ?>
	</div>


	<div class="row">
		<?php echo $form->labelEx($model,'Bp_cantdespachada'); ?>
		<?php echo $form->textField($model,'Bp_cantdespachada',array('style'=>'width:23%',"class"=>"form-group  form-control")); ?>
		<?php echo"<img src='../images/help_icon.gif' class='tooltipster' title='Cantidad numérica despachada de un determinado producto.'>" ?>
		<?php echo $form->error($model,'Bp_cantdespachada'); ?>
	</div>


	<div class="row">
		<?php echo $form->labelEx($model,'Bp_documento'); ?>
		<?php echo $form->textField($model,'Bp_documento', array('style'=>'width:23%',"class"=>"form-group  form-control")); ?>
		<?php echo"<img src='../images/help_icon.gif' class='tooltipster' title='Por definir'>" ?>
		<?php echo $form->error($model,'Bp_documento'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Agregar' : 'Guardar',array("class"=>"btn btn-primary")); ?>
		<?php echo CHtml::submitButton('Cancelar',array('name'=>'cancelar',"class"=>"btn btn-primary")); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->